package com.lhc.Homework1;


import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class SortByWord {
    public static void main(String[] args) {

        SortByWd();
    }
    public static void SortByWd()
    {
        List<String>list=new ArrayList<>();
        System.out.println("输入字符串：");
        Scanner sc=new Scanner(System.in);
        for (int i=0;i<5;i++) {
            String str = sc.next();
            list.add(str);
        }
        Collections.sort(list);

        for (int i=0;i<list.size();i++)
        {
            System.out.println(list.get(i));
        }
    }
}
